<!DOCTYPE html>
<html lang="en">
 
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="../jQuery/jquery.min.js"></script>
    <style>
        ul {
            height: 2000px;
            ;
        }
        
        li {
            height: 50px;
            margin-top: 20px;
            border: 1px solid #CCC;
        }
        
        .back {
            position: fixed;
            right: 10px;
            bottom: 20px;
            width: 50px;
            height: 100px;
            background-color: #ccc;
            display: none
        }
        
        .hh {
            height: 400px;
        }
    </style>
</head>
 
<body>
    <div class="back">
        back
    </div>
    <ul>
        <li>1</li>
        <li>2</li>
        <li class="active">3</li>
        <li class="hh">4</li>
 
        <li class="goback">3234</li>
    </ul>
 
 
 
    <script>
        $(function() {
            var backShowHeight = $(".goback").offset().top;
            $(window).scroll(function(event) {
                var scrollTop = $(document).scrollTop();
                var screenHeght = $(window).height();
                console.log(screenHeght)
                console.log("scrollTop" + scrollTop)
                console.log("backShowHeight" + backShowHeight)
                if (scrollTop >= backShowHeight - screenHeght) {
                    $(".back").css('display', "block");
                } else {
                    $(".back").css('display', "none");
                }
            })
        })
    </script>
</body>
 
</html>